package com.yupi.usercenter.basic.enums;


/**
 * 云路供应链科技有限公司 版权所有 © Copyright 2019<br>
 *
 * @Description: 枚举的ID必须要从300开始，依次往下，最新的枚举放在最上面
 * 枚举的type必须从ZD100开始，依次往下，最新的枚举放在最上面
 * 如果包含修改id的   放最上面
 * @Project:
 * @CreateDate: 2019/9/10 15:24
 * @Author: renshuxian
 */

public enum NetworkCategoryEnum {

    /***
     * 网点类型
     */
    NETWORK_TYPE_HEADQUARTERS(22, "ZD08", "16", "总部", "网点类型"),
    NETWORK_TYPE_AGENT_AREA(334, "ZD08", "17", "代理区", "网点类型"),
    NETWORK_TYPE_CENTER(335, "ZD08", "18", "中心", "网点类型"),
    NETWORK_TYPE_FIRST_LEVEL(336, "ZD08", "19", "一级网点", "网点类型"),
    NETWORK_TYPE_SECOND_LEVEL(337, "ZD08", "20", "二级网点", "网点类型"),
    ;

    NetworkCategoryEnum(Integer id, String type, String code, String name, String description) {
        this.id = id;
        this.type = type;
        this.code = code;
        this.name = name;
        this.description = description;
    }

    /***
     * 根据id查询枚举name
     * @param id
     * @return
     */
    public static String getNameById(Integer id) {
        for (NetworkCategoryEnum networkCategoryEnum : NetworkCategoryEnum.values()) {
            if (networkCategoryEnum.getId().equals(id)) {
                return networkCategoryEnum.getName();
            }
        }
        return null;
    }

    /***
     * 根据name查询枚举id
     * @param name
     * @return
     */
    public static Integer getIdByName(String name) {
        for (NetworkCategoryEnum networkCategoryEnum : NetworkCategoryEnum.values()) {
            if (networkCategoryEnum.getName().equals(name)) {
                return networkCategoryEnum.getId();
            }
        }
        return null;
    }

    /***
     * 根据id查询枚举code
     * @param id
     * @return
     */
    public static String getCodeById(Integer id) {
        for (NetworkCategoryEnum networkCategoryEnum : NetworkCategoryEnum.values()) {
            if (networkCategoryEnum.getId().equals(id)) {
                return networkCategoryEnum.getCode();
            }
        }
        return null;
    }


    private String code;

    private Integer id;

    private String name;

    private String cnName;

    private String enName;

    private String type;

    private String description;

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }


    public String getCnName() {
        return cnName;
    }

    public void setCnName(String cnName) {
        this.cnName = cnName;
    }

    public String getEnName() {
        return enName;
    }

    public void setEnName(String enName) {
        this.enName = enName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}
